<?php
class ModelHistory extends Model {
	private static $cmds = array();
	private static $idx = -1;
	
	public static function add($s) {
		self::$idx ++;
		self::$cmds[self::$idx] = $s;
	}
	
	public static function getCurrent() {
		if(self::$idx >= 0)
			return self::$cmds[self::$idx];
		return null;
	}
	
	public static function getPrevious() {
		if(self::$idx > 0) {
			self::$idx --;
			return self::getCurrent();
		}
		return null;
	}
	
	public static function getNext() {
		if(self::$idx < count(self::$cmds) - 1) {
			self::$idx ++;
			return self::getCurrent();
		}
		return null;
	}
}